import React, {
    Component
} from 'react';
import {
    Platform,
    StyleSheet,
    Text,
    View,
    Dimensions,
    FlatList,
    TouchableOpacity
} from 'react-native';
import Orientation from 'react-native-orientation';
var ScreenWidth = Dimensions.get('window').width;
var ScreenHeight = Dimensions.get('window').height;
export default class MyListItem extends Component {

    render() {
        return ( 
            <TouchableOpacity onPress={this.props.onPressItem}>
                    <View style={[this.props.activeIndex==this.props.item.id?styles.main2:styles.main]} >
                        <Text style={[this.props.activeIndex==this.props.item.id?styles.fontColor:styles.activefontColor]}>{this.props.item.id}场</Text>
                    </View>
            </TouchableOpacity>

        )
    }
}
const styles = StyleSheet.create({
    main2:{
        flex: 1,
        backgroundColor:'#198fff',
        justifyContent: 'center',
        alignItems: 'center',
        flexDirection: 'row',
        marginTop: 3,
        marginBottom: 3,
        height:40,
        width:80,
        borderRadius: 5,
        
    },
    main:{
        flex: 1,
        backgroundColor:'#dbdbdb',
        justifyContent: 'center',
        alignItems: 'center',
        flexDirection: 'row',
        marginTop: 3,
        marginBottom: 3,
        height:40,
        width:80,
        borderRadius: 5,
        opacity:0.5
    },
    fontColor:{
        color:'#ffffff',
        fontSize: 18,
    },
    activefontColor:{
        color:'#000000',
        fontSize: 18,
    }
    
})